﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tilver.Coder.CommandExcuteResult;

namespace Tilver.Coder.Utility
{
    public static class ExecuteResultUtil
    {
        public static ExecuteResultBase Create(ExecuteResultEnum type)
        {
            switch (type)
            {
                case ExecuteResultEnum.ExecuteNonQuery:
                    return new ExecuteNonQueryResult();
                case ExecuteResultEnum.ExecuteScalar:
                    return new ExecuteScalarResult();
                case ExecuteResultEnum.ExecuteSingle:
                    return new ExecuteSingleResult();
                case ExecuteResultEnum.ExecuteReader:
                    return new ExecuteReaderResult();
                default:
                    throw new NotSupportedException();
            }
        }
    }
}
